package com.zhangsun.multiConfig.controller;

import cn.hutool.log.StaticLog;
import com.zhangsun.db1.service.DB1UserService;
import com.zhangsun.db2.service.DB2UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private DB1UserService db1UserService;

    @Autowired
    private DB2UserService db2UserService;

    @RequestMapping("/test")
    public String test() {
        db1UserService.findAll().forEach(item -> StaticLog.info(item.toString()));
        db2UserService.findAll().forEach(item -> StaticLog.info(item.toString()));
        return "success";
    }

}
